package com.wanxi.api;

public class MyMath {
    //    private MyMath(){}
//    public MyMath(String name) {
//
//    }
    private int delete(int a) {
        return a;
    }

    public static int add(int a, int b) {

        return new MyMath().delete(a) + b;
    }

    public static int max(int a, int b) {
        return a > b ? a : b;
    }

    public static int random(int a) {
//        [0,1)的随机数，小数
        double random = Math.random();
//        5.32342  5.876543243
        int randomInt = (int) (random * 10);
        return randomInt;

    }

    public static double avg(int... arr) {

        double sum = 0.0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum / arr.length;
    }
}
